<!-- 安全巡查-基本资料-专家人员库 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          <el-col :span="6">
            <el-form-item label="人员编号">
              <el-input v-model="listQuery.fcatno" placeholder="人员编号" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="人员名称">
              <el-input v-model="listQuery.fcatname" placeholder="人员名称" clearable />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="warning" icon="el-icon-upload2">导入</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FCATNO" label="人员编号" ></el-table-column>
          <el-table-column prop="FCATNAME" label="人员姓名"></el-table-column>
          <el-table-column prop="FSEX" label="性别" width="85">
            <template slot-scope="scope">
              {{ scope.row.FVISIBLE | dynamicText(fvisiblelist2) }}
            </template>
          </el-table-column>
          <el-table-column prop="FTELNO" label="手机号码"> </el-table-column>
          <el-table-column prop="FIDNO" label="身份证号"> </el-table-column>
          <el-table-column prop="FUNIT" label="工作单位"> </el-table-column>
          <el-table-column prop="FWORK" label="工作职称"> </el-table-column>
          <el-table-column prop="FMEMO" label="备注"> </el-table-column>
          <el-table-column prop="FVISIBLE" label="账号状态" width="105">
            <template slot-scope="scope">
              {{ scope.row.FVISIBLE | dynamicText(fvisiblelist) }}
            </template>
          </el-table-column>
          <el-table-column fixed="left" label="操作" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import Form from "./Form.vue"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        fvisiblelist: [
          { id: "1", fullName: "正常" },
          { id: "2", fullName: "注销" },
        ],
        fvisiblelist2: [
          { id: "1", fullName: "男" },
          { id: "2", fullName: "女" },
        ],
        total: 0,
        list: [
        {
          "FCATNO": "W1001",
          "FCATNAME": "司马懿",
          "FTELNO": "17780901235",
          "FIDNO":"",
          "FUNIT":"",
          "FWORK":"",
          "FMEMO":"综合管理专家",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FIMAGE": null,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FCATNO": "W1002",
          "FCATNAME": "朱元璋",
          "FTELNO": "16790872156",
          "FIDNO":"",
          "FUNIT":"",
          "FWORK":"",
          "FMEMO":"物理安全专家",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FIMAGE": null,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ,{
          "FCATNO": "W1003",
          "FCATNAME": "老子",
          "FTELNO": "13918840503",
          "FIDNO":"",
          "FUNIT":"",
          "FWORK":"",
          "FMEMO":"化学安全专家",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FIMAGE": null,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ,{
          "FCATNO": "W1004",
          "FCATNAME": "庄子",
          "FTELNO": "13501884042",
          "FIDNO":"",
          "FUNIT":"",
          "FWORK":"",
          "FMEMO":"生物安全专家",
          "FSEQNO": 28,
          "FVISIBLE": 1,
          "FIMAGE": null,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],
        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fcatno: "",
          fcatname: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>